package Actions;
/*
 * Written by Phat Le
 */
import java.awt.event.ActionEvent;
import java.awt.event.KeyEvent;
import javax.swing.AbstractAction;
import javax.swing.JOptionPane;
import javax.swing.JTable;
import Model.SubProgramChair;
import View.SubmitRecommendationView;
/**
 * SubPC do submit rec.
 * @author Phat
 *
 */
public class SubmitRec extends AbstractAction {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private SubProgramChair spc;
	private SubmitRecommendationView submitRec;
	private JTable table;
	
	public SubmitRec(JTable table, SubProgramChair a_spc) {
		this.table = table;
		this.putValue(NAME, "Submit Rec");
		this.putValue(MNEMONIC_KEY, KeyEvent.VK_R);
		spc = a_spc;
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if(table.getSelectedRow() != -1){
			submitRec = new SubmitRecommendationView(this.table, spc);
			submitRec.start();
			submitRec.updateLabels();
		} else{
			JOptionPane.showMessageDialog(null, "Please select a manuscript to submit recomendation");
		}
			

	}

}


